
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Mr Bao
 */
public class UploadChose extends List implements CommandListener {

    private UpAnh upAnh;
    private Command cmdBack = new Command("Back", Command.BACK, 2);

    public UploadChose(UpAnh upAnh) {
        super("Up Anh", IMPLICIT);
        this.upAnh = upAnh;
        append("Anh trong may", null);
        append("Chup anh", null);
        addCommand(cmdBack);
        setCommandListener(this);
    }

    public void commandAction(Command c, Displayable d) {
        if (c == cmdBack) {
            upAnh.DisplayUploadImageBack();
        } else if (c == SELECT_COMMAND) {
            switch (getSelectedIndex()) {
                case 0:
                    upAnh.DisplayBrowser();
                    break;
                case 1:
                    upAnh.DisplayCamera();
                    break;
            }
        }
    }
}
